{% extends 'studentes/base.html' %}
{% block students_index %}
    <div class="container">
        <div style="margin-top: 40px"></div>
        {#        {% for i in a %}#}
        {#            {% for j in i %}#}
        {#                <h5>练习题：{{ j.exercises.exercises }}</h5>#}
        {#                <h5>时间：{{ j.myTime }}</h5>#}
        {#                <h5>成绩：{{ j.grade }}</h5>#}
        {#                <h5> id：{{ j.id }}</h5>#}
        {#                <h5> id：{{ i }}</h5>#}
        {#                <hr>#}
        {#            {% endfor %}#}


        {#        {% endfor %}#}

        {% for i in exercise %}



            <div class="alert alert-primary text-black" role="alert">
                <div class="row">
                    <div class="col-md-9">
                        <h5>{{ i.exercises }}
                            {% if i.exercises2_set.get != '' %}
                                <span class="badge bg-success " style="font-size: 10px">已完成</span>
                            {% else %}
                                <span class="badge bg-warning text-dark" style="font-size: 10px">待完成</span>
                            {% endif %}
                        </h5>

                        <p>
                            创建时间：{{ i.myTime }}
                        </p>
                    </div>
                    <div class="col-3 text-center">

                        {% if i.exercises2_set.get != '' %}
                            <h3 style="color:#de2323;font-family: '华文行楷'">成绩：{{ i.exercises2_set.get }} %</h3>
                            <a href="{% url 'students_showGrade' i.course.id  i.id %}" class="btn btn-sm btn-primary">查看作业</a>
                        {% else %}
                            <p></p>
                            <a href="{% url 'students_exercises_start' i.course.id  i.id %}"
                               class="btn btn-primary w-50 ">开始做</a>
                        {% endif %}


                    </div>
                </div>
            </div>
        {% endfor %}

    </div>

{% endblock %}